﻿#pragma once
#include <QWidget>
#include "ui_ApMainWindow.h"
#include "CommunicationDialog.h"
#include "Refactor3DDialog.h"
#include "ConfigDialog.h"
#include "ProcessCore.h"

#include "DataExportor.h"

#include <AsThread>

QT_BEGIN_NAMESPACE
namespace Ui { class ApMainWindowClass; };
QT_END_NAMESPACE

class ApMainWindow : public QWidget {
	Q_OBJECT

public:
	ApMainWindow(QWidget *parent = nullptr);
	~ApMainWindow();

private:
	void init();
	void initCustomPlot();
	void initSonDialog();
	
public slots:
	void pciParamChanged();
	void OnSelectListWidgetItem(QListWidgetItem* item);

private slots:
	void on_pushButton_setting_clicked();
	void on_pushButton_debug_clicked();
	void on_pushButton_show3d_clicked();
	void on_pushButton_start_clicked();
	void on_pushButton_stop_clicked();
	void on_pushButton_pause_clicked();
	void on_pushButton_continue_clicked();
	void on_pushButton_confirmHeight_clicked();
	void on_pushButton_confirmAll_clicked();
	void on_pushButton_export_clicked();

	void on_context_menu(const QPoint &point);

	void flushCustomPlot(int index);

	void updatePortInformation(HSS::PortInformation portinfo);

	void releaseButtons();
	void aviliable3DButton();
private:
	Ui::ApMainWindowClass *ui;
	CommunicationDialog *m_communicationDialog;
	ConfigDialog *m_configDialog;
	Refactor3DDialog *m_show3dDialog;

	QListWidgetItem *m_summaryItem;

	ProcessCore *m_pCore;

	AsThread *m_pThread;

	DataExportor *m_exportor;
};
